//列表区可以显示所有的物料
//key对应的组件映射关系
import {ElButton, ElInput  }from 'element-plus'

function createEditorconfig(){
const componentList=[];
const componentMap={};

return {
    componentList,
    componentMap,
    register:(component)=>{
        componentList.push(component)
        componentMap[component.key]=component
    }
}
}
export  let registerCongif=createEditorconfig()

registerCongif.register({
    label:"文本",
    preview:()=>'预览文本',
    render:()=>"预览文本",
    key:"text"
})
registerCongif.register({
    label:"按钮",
    preview:()=><ElButton>预览</ElButton>,
    render:()=><ElButton>渲染</ElButton>,
    key:"button"
})
registerCongif.register({
    label:"输入框",
    preview:()=><ElInput placeholder="预览输入框"></ElInput>,
    render:()=><ElInput placeholder="渲染输入框"></ElInput>,
    key:"input"
})
// console.log(registerCongif)